package mypro1;

public class Testprime{
    public static void main(String[] args) {
        int sum = 0;
        for (int a = 1; a <= 10000; a++) {
            for (int b = 2; b <= a; b++) {
                if (a % b == 0) {
                    if (a == b) {
                        System.out.println(a + "是素数");
                        sum = sum + 1;
                    } else {
                        break;
                    }
                }
            }
        }
        System.out.println("10000以内的素数个数是" + sum + "个");
        System.gc();
    }
}
